<include file="../Public/header" />



<script type="text/javascript" src="__PUBLIC__/js/json2select.js"></script>
</head>
<body>
<style type="text/css">
	ul ul {margin: auto; padding:0 0 0 40px;	list-style-type: none;}
</style>
<div id="container">
<div class="form_n">
  <form method="post" id="basic_setting" name="form" action="{:U('admin/Cms/doAddCategory')}">
    <TABLE width="100%" cellpadding=3 cellspacing=3  class="form">
      <TR>
        <TD width="80"  class="th" align="right" ><strong>分类标题：</strong></TD>
        <TD class="td" ><INPUT TYPE="text" class="large bLeftRequire" NAME="title"></TD>
      </TR>
      <TR>
        <TD class="th" align="right"  ><strong>英文名：</strong></TD>
        <TD class="td" ><INPUT TYPE="text" class="large bLeftRequire" NAME="name"></TD>
      </TR>
      <TR>
        <TD class="th"  align="right" ><strong>父分类：</strong></TD>
        <TD class="td" ><div id="category"></div></TD>
      </TR>
      <TR>
        <TD height="40"></TD>
        <TD height="40" class="center"><input type="submit" value="增加" class="button hMargin small fLeft " /></TD>
      </TR>
    </TABLE>
  </form>
  </div>
  <div>
  <table class="form" width="100%">
    <tbody>
      <!--<tr class="top">
        <td class="border" colspan="6">分类管理</td>
      </tr>-->
 <tr>
        <td class="tit" colspan="6">分类管理
          </td>
      </tr>
      <tr class="label" height="40">
        <th>ID/分类名</th>
        <th></th>
        <th align="right">操作</th>
      </tr>
      <tr class="cell altbg1">
        <td colspan="3">{$categoryList}</td>
      </tr>
      <tr class="bottom">
        <td class="border" colspan="6">&nbsp;</td>
      </tr>
    </tbody>
  </table>
  </div>

<script type="text/javascript">
$(function(){
	var category_json = {$category_json};
	$("#category").json2select(category_json,'1','category','1');		   
});

/* 编辑分类 */
function edit(id){
	var url = "{:U('admin/Cms/editCategory')}&id="+id;
	window.location.href = url;
}

/* 删除分类 */
function del(id){
	if (window.confirm('确实要删除选择项吗？'))
	{					
		var url = "{:U('admin/Cms/delCategory')}&id="+id;
		window.location.href = url;			
	}
}

</script>
  <!-- 主页面结束 -->
</div>
